package cn.zlp.hrm.exception;

/**
 * @program: hrm-parent
 * @author: Mr.Zhang
 * @create: 2022-01-03 10:52
 **/
public class GlobalException extends RuntimeException {

    //错误码
    private int errorCode = 500;

    //默认构造函数
    public GlobalException() {
    }

    //带错误消息构造
    public GlobalException(String message) {
        super(message);
    }
    //带错误消息+异常构造
    public GlobalException(String message, Throwable cause) {
        super(message, cause);
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    //支持错误吗构造
    public GlobalException(int errorCode,String message) {
        super(message);
        this.errorCode = errorCode;
    }
}
